import request from '@/utils/request'

function formatRequestUri(name) {
  return 'form/page/calculate/' + name
}

export function Statistics(data) {
  return request({
    url: formatRequestUri('Statistics'),
    method: 'post',
    data
  })
}

export function Chart(data) {
  return request({
    url: formatRequestUri('Chart'),
    method: 'post',
    data
  })
}

export function CensusTable(data) {
  return request({
    url: formatRequestUri('CensusTable'),
    method: 'post',
    data
  })
}

export function DataTable(query, paging) {
  return request({
    url: formatRequestUri('DataTable'),
    method: 'post',
    data: {
      Query: query,
      Index: paging.Index,
      Size: paging.Size,
      SortName: paging.SortName,
      IsDesc: paging.IsDesc
    }
  })
}
